Integrand size = 19, antiderivative size = 138 \[ \int \frac {\cot (c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {\log (\cos (c+d x))}{a^2 d}+\frac {\log (1-\sec (c+d x))}{2 (a+b)^2 d}+\frac {\log (1+\sec (c+d x))}{2 (a-b)^2 d}-\frac {b^2 \left (3 a^2-b^2\right ) \log (a+b \sec (c+d x))}{a^2 \left (a^2-b^2\right )^2 d}+\frac {b^2}{a \left (a^2-b^2\right ) d (a+b \sec (c+d x))} \]
ln(cos(d*x+c))/a^2/d+1/2*ln(1-sec(d*x+c))/(a+b)^2/d+1/2*ln(1+sec(d*x+c))/( a-b)^2/d-b^2*(3*a^2-b^2)*ln(a+b*sec(d*x+c))/a^2/(a^2-b^2)^2/d+b^2/a/(a^2-b ^2)/d/(a+b*sec(d*x+c))
Time = 0.43 (sec) , antiderivative size = 136, normalized size of antiderivative = 0.99 \[ \int \frac {\cot (c+d x)}{(a+b \sec (c+d x))^2} \, dx=-\frac {b^2 \left (-\frac {\log (\cos (c+d x))}{a^2 b^2}-\frac {\log (1-\sec (c+d x))}{2 b^2 (a+b)^2}-\frac {\log (1+\sec (c+d x))}{2 (a-b)^2 b^2}+\frac {\left (3 a^2-b^2\right ) \log (a+b \sec (c+d x))}{a^2 (a-b)^2 (a+b)^2}-\frac {1}{a \left (a^2-b^2\right ) (a+b \sec (c+d x))}\right )}{d} \]
-((b^2*(-(Log[Cos[c + d*x]]/(a^2*b^2)) - Log[1 - Sec[c + d*x]]/(2*b^2*(a + b)^2) - Log[1 + Sec[c + d*x]]/(2*(a - b)^2*b^2) + ((3*a^2 - b^2)*Log[a + b*Sec[c + d*x]])/(a^2*(a - b)^2*(a + b)^2) - 1/(a*(a^2 - b^2)*(a + b*Sec[c + d*x]))))/d)
Time = 0.37 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.01, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3042, 25, 4373, 615, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cot (c+d x)}{(a+b \sec (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int -\frac {1}{\cot \left (c+d x+\frac {\pi }{2}\right ) \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2}dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int \frac {1}{\cot \left (\frac {1}{2} (2 c+\pi )+d x\right ) \left (a+b \csc \left (\frac {1}{2} (2 c+\pi )+d x\right )\right )^2}dx\) |
\(\Big \downarrow \) 4373 |
\(\displaystyle -\frac {b^2 \int \frac {\cos (c+d x)}{b (a+b \sec (c+d x))^2 \left (b^2-b^2 \sec ^2(c+d x)\right )}d(b \sec (c+d x))}{d}\) |
\(\Big \downarrow \) 615 |
\(\displaystyle -\frac {b^2 \int \left (\frac {3 a^2-b^2}{a^2 (a-b)^2 (a+b)^2 (a+b \sec (c+d x))}+\frac {\cos (c+d x)}{a^2 b^3}+\frac {1}{2 b^2 (a+b)^2 (b-b \sec (c+d x))}-\frac {1}{2 (a-b)^2 b^2 (\sec (c+d x) b+b)}+\frac {1}{a (a-b) (a+b) (a+b \sec (c+d x))^2}\right )d(b \sec (c+d x))}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {b^2 \left (-\frac {1}{a \left (a^2-b^2\right ) (a+b \sec (c+d x))}+\frac {\log (b \sec (c+d x))}{a^2 b^2}+\frac {\left (3 a^2-b^2\right ) \log (a+b \sec (c+d x))}{a^2 \left (a^2-b^2\right )^2}-\frac {\log (b-b \sec (c+d x))}{2 b^2 (a+b)^2}-\frac {\log (b \sec (c+d x)+b)}{2 b^2 (a-b)^2}\right )}{d}\) |
-((b^2*(Log[b*Sec[c + d*x]]/(a^2*b^2) - Log[b - b*Sec[c + d*x]]/(2*b^2*(a + b)^2) + ((3*a^2 - b^2)*Log[a + b*Sec[c + d*x]])/(a^2*(a^2 - b^2)^2) - Lo g[b + b*Sec[c + d*x]]/(2*(a - b)^2*b^2) - 1/(a*(a^2 - b^2)*(a + b*Sec[c + d*x]))))/d)
3.4.4.3.1 Defintions of rubi rules used
Int[((e_.)*(x_))^(m_.)*((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Int[ExpandIntegrand[(e*x)^m*(c + d*x)^n*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && ILtQ[p, 0]
Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n _), x_Symbol] :> Simp[-(-1)^((m - 1)/2)/(d*b^(m - 1)) Subst[Int[(b^2 - x^ 2)^((m - 1)/2)*((a + x)^n/x), x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]
Time = 1.05 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.83
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (\cos \left (d x +c \right )+1\right )}{2 \left (a -b \right )^{2}}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 \left (a +b \right )^{2}}-\frac {b^{3}}{a^{2} \left (a +b \right ) \left (a -b \right ) \left (b +a \cos \left (d x +c \right )\right )}-\frac {b^{2} \left (3 a^{2}-b^{2}\right ) \ln \left (b +a \cos \left (d x +c \right )\right )}{\left (a +b \right )^{2} \left (a -b \right )^{2} a^{2}}}{d}\) | \(114\) |
default | \(\frac {\frac {\ln \left (\cos \left (d x +c \right )+1\right )}{2 \left (a -b \right )^{2}}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 \left (a +b \right )^{2}}-\frac {b^{3}}{a^{2} \left (a +b \right ) \left (a -b \right ) \left (b +a \cos \left (d x +c \right )\right )}-\frac {b^{2} \left (3 a^{2}-b^{2}\right ) \ln \left (b +a \cos \left (d x +c \right )\right )}{\left (a +b \right )^{2} \left (a -b \right )^{2} a^{2}}}{d}\) | \(114\) |
risch | \(\frac {i x}{a^{2}}-\frac {i x}{a^{2}+2 a b +b^{2}}-\frac {i c}{d \left (a^{2}+2 a b +b^{2}\right )}-\frac {i x}{a^{2}-2 a b +b^{2}}-\frac {i c}{d \left (a^{2}-2 a b +b^{2}\right )}+\frac {6 i b^{2} x}{a^{4}-2 a^{2} b^{2}+b^{4}}+\frac {6 i b^{2} c}{d \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}-\frac {2 i b^{4} x}{a^{2} \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}-\frac {2 i b^{4} c}{a^{2} d \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}+\frac {2 b^{3} {\mathrm e}^{i \left (d x +c \right )}}{a^{2} d \left (-a^{2}+b^{2}\right ) \left (a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{i \left (d x +c \right )}+a \right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d \left (a^{2}+2 a b +b^{2}\right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d \left (a^{2}-2 a b +b^{2}\right )}-\frac {3 b^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{d \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}+\frac {b^{4} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{a^{2} d \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}\) | \(413\) |
1/d*(1/2/(a-b)^2*ln(cos(d*x+c)+1)+1/2/(a+b)^2*ln(cos(d*x+c)-1)-1/a^2*b^3/( a+b)/(a-b)/(b+a*cos(d*x+c))-b^2*(3*a^2-b^2)/(a+b)^2/(a-b)^2/a^2*ln(b+a*cos (d*x+c)))
Time = 0.35 (sec) , antiderivative size = 234, normalized size of antiderivative = 1.70 \[ \int \frac {\cot (c+d x)}{(a+b \sec (c+d x))^2} \, dx=-\frac {2 \, a^{2} b^{3} - 2 \, b^{5} + 2 \, {\left (3 \, a^{2} b^{3} - b^{5} + {\left (3 \, a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )\right )} \log \left (a \cos \left (d x + c\right ) + b\right ) - {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3} + {\left (a^{5} + 2 \, a^{4} b + a^{3} b^{2}\right )} \cos \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (a^{4} b - 2 \, a^{3} b^{2} + a^{2} b^{3} + {\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} \cos \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, {\left ({\left (a^{7} - 2 \, a^{5} b^{2} + a^{3} b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{6} b - 2 \, a^{4} b^{3} + a^{2} b^{5}\right )} d\right )}} \]
-1/2*(2*a^2*b^3 - 2*b^5 + 2*(3*a^2*b^3 - b^5 + (3*a^3*b^2 - a*b^4)*cos(d*x + c))*log(a*cos(d*x + c) + b) - (a^4*b + 2*a^3*b^2 + a^2*b^3 + (a^5 + 2*a ^4*b + a^3*b^2)*cos(d*x + c))*log(1/2*cos(d*x + c) + 1/2) - (a^4*b - 2*a^3 *b^2 + a^2*b^3 + (a^5 - 2*a^4*b + a^3*b^2)*cos(d*x + c))*log(-1/2*cos(d*x + c) + 1/2))/((a^7 - 2*a^5*b^2 + a^3*b^4)*d*cos(d*x + c) + (a^6*b - 2*a^4* b^3 + a^2*b^5)*d)
\[ \int \frac {\cot (c+d x)}{(a+b \sec (c+d x))^2} \, dx=\int \frac {\cot {\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{2}}\, dx \]
Time = 0.20 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.03 \[ \int \frac {\cot (c+d x)}{(a+b \sec (c+d x))^2} \, dx=-\frac {\frac {2 \, b^{3}}{a^{4} b - a^{2} b^{3} + {\left (a^{5} - a^{3} b^{2}\right )} \cos \left (d x + c\right )} + \frac {2 \, {\left (3 \, a^{2} b^{2} - b^{4}\right )} \log \left (a \cos \left (d x + c\right ) + b\right )}{a^{6} - 2 \, a^{4} b^{2} + a^{2} b^{4}} - \frac {\log \left (\cos \left (d x + c\right ) + 1\right )}{a^{2} - 2 \, a b + b^{2}} - \frac {\log \left (\cos \left (d x + c\right ) - 1\right )}{a^{2} + 2 \, a b + b^{2}}}{2 \, d} \]
-1/2*(2*b^3/(a^4*b - a^2*b^3 + (a^5 - a^3*b^2)*cos(d*x + c)) + 2*(3*a^2*b^ 2 - b^4)*log(a*cos(d*x + c) + b)/(a^6 - 2*a^4*b^2 + a^2*b^4) - log(cos(d*x + c) + 1)/(a^2 - 2*a*b + b^2) - log(cos(d*x + c) - 1)/(a^2 + 2*a*b + b^2) )/d
Leaf count of result is larger than twice the leaf count of optimal. 303 vs. \(2 (134) = 268\).
Time = 0.32 (sec) , antiderivative size = 303, normalized size of antiderivative = 2.20 \[ \int \frac {\cot (c+d x)}{(a+b \sec (c+d x))^2} \, dx=-\frac {\frac {2 \, {\left (3 \, a^{2} b^{2} - b^{4}\right )} \log \left ({\left | -a - b - \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} \right |}\right )}{a^{6} - 2 \, a^{4} b^{2} + a^{2} b^{4}} - \frac {\log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{a^{2} + 2 \, a b + b^{2}} - \frac {2 \, {\left (3 \, a^{2} b^{2} + 4 \, a b^{3} + b^{4} + \frac {3 \, a^{2} b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {b^{4} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )}}{{\left (a^{5} + a^{4} b - a^{3} b^{2} - a^{2} b^{3}\right )} {\left (a + b + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )}} + \frac {2 \, \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right )}{a^{2}}}{2 \, d} \]
-1/2*(2*(3*a^2*b^2 - b^4)*log(abs(-a - b - a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + b*(cos(d*x + c) - 1)/(cos(d*x + c) + 1)))/(a^6 - 2*a^4*b^2 + a^ 2*b^4) - log(abs(-cos(d*x + c) + 1)/abs(cos(d*x + c) + 1))/(a^2 + 2*a*b + b^2) - 2*(3*a^2*b^2 + 4*a*b^3 + b^4 + 3*a^2*b^2*(cos(d*x + c) - 1)/(cos(d* x + c) + 1) - b^4*(cos(d*x + c) - 1)/(cos(d*x + c) + 1))/((a^5 + a^4*b - a ^3*b^2 - a^2*b^3)*(a + b + a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - b*(co s(d*x + c) - 1)/(cos(d*x + c) + 1))) + 2*log(abs(-(cos(d*x + c) - 1)/(cos( d*x + c) + 1) + 1))/a^2)/d
Time = 14.62 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.16 \[ \int \frac {\cot (c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d\,\left (a^2+2\,a\,b+b^2\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{a^2\,d}-\frac {b^2\,\ln \left (a+b-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )\,\left (3\,a^2-b^2\right )}{a^2\,d\,{\left (a^2-b^2\right )}^2}-\frac {2\,b^3}{a\,d\,\left (a+b\right )\,{\left (a-b\right )}^2\,\left (\left (b-a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a+b\right )} \]